package tgc.edu.yzy.custom;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

import tgc.edu.yzy.jdbc.OpenLayoutJDBC;

public class DlCustom {
	
	public static String dl(String url) {
		url =  OpenLayoutJDBC.saveDl(url);
    	return "http://yzycoc.com/i/"+url;
    }

	private static String dlseven(String url) {
		Map<String,Object> data1 = new HashMap<String,Object>();
		data1.put("key", "5d8f5c1eb1a9c76f7d27dadf@3d8a8a99d129e8a213467d4b28a66059");
		data1.put("expireDate", TimeUtils.endDd());
		data1.put("url", url);
		String url2 = url;
		for (int i = 0; i < 15; i++) {
			try {
	        	url2 = BackEndHttpRequest.getURL("http://suo.im/api.htm", data1, "GET");
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
        return url2;
	}

	private static String dlsix(String url) {
		Map<String,Object> data1 = new HashMap<String,Object>();
		data1.put("key", "5d8f5ad28e676d6985ba6b1a@0a555a7e3f262018fe493ed1e752816f");
		data1.put("expireDate", TimeUtils.endDd());
		data1.put("url", url);
		String url2 = url;
		for (int i = 0; i < 15; i++) {
			try {
	        	url2 = BackEndHttpRequest.getURL("http://suo.im/api.htm", data1, "GET");
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
        return url2;
	}

	private static String dlfour(String url) {
		Map<String,Object> data1 = new HashMap<String,Object>();
		data1.put("apikey", "mEjoAYQcf3Vu2soQnR@ddd");
		data1.put("url", url);
		String url2 = url;
		for (int i = 0; i < 15; i++) {
			try {
	        	url2 = BackEndHttpRequest.getURL("http://api.985.so/api.php", data1, "GET");
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
        return url2;
	}

	private static String dlthree(String url) {
		Map<String,Object> data1 = new HashMap<String,Object>();
		data1.put("qqdrsign", "0149b");
		data1.put("url", url);
		String url2 = url;
		for (int i = 0; i < 15; i++) {
			try {
	        	url2 = BackEndHttpRequest.getURL("http://sa.sogou.com/gettiny", data1, "GET");
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
        return url2;
	}

	private static String dltwo(String url) {
		Map<String,Object> data1 = new HashMap<String,Object>();
		data1.put("key", "5d8ebd2fb1a9c76f7d27dabe@d4a5aa6a73884b6add8fedc7ad330b49");
		data1.put("expireDate", TimeUtils.endDd());
		data1.put("url", url);
		String url2 = url;
		for (int i = 0; i < 15; i++) {
			try {
	        	url2 = BackEndHttpRequest.getURL("http://suo.im/api.htm", data1, "GET");
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
        return url2;
	}

	private static String dlone(String url) {
		Map<String,Object> data1 = new HashMap<String,Object>();
		data1.put("key", "5d8b0e118e676d74690e5635@227a486b2b57e1f423e7609b9c72d7ee");
		data1.put("expireDate", TimeUtils.endDd());
		data1.put("url", url);
		String url2 = url;
		for (int i = 0; i < 15; i++) {
			try {
	        	url2 = BackEndHttpRequest.getURL("http://suo.im/api.htm", data1, "GET");
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
        return url2;
	}
}
